import Vue from 'vue';
import Router from 'vue-router';

/* layout */
import Layout from '../views/layout/Layout';
import littleLayout from '../views/layout/littleLayout';
/* login */
import Login from '../views/login/';
const authRedirect = resolve => require(['../views/login/authredirect'], resolve);
const reset = resolve => require(['../views/login/reset'], resolve);
const newPassword = resolve => require(['../views/login/newPassword'], resolve);
const resetSuccess = resolve => require(['../views/login/resetSuccess'], resolve);
const studentBackPassword = resolve => require(['../views/login/studentBackPassword'], resolve);

/* home 数据统计*/
const home = resolve => require(['../views/home/index'], resolve);
const teacherActive = resolve => require(['../views/home/teacherActive'], resolve);

/* Introduction */
const Introduction = resolve => require(['../views/introduction/index'], resolve);

/* error page */
const Err404 = resolve => require(['../views/error/404'], resolve);
const Err401 = resolve => require(['../views/error/401'], resolve);
const error = resolve => require(['../views/error/serverMaintenance'], resolve);

/* error log */
const ErrorLog = resolve => require(['../views/errlog/index'], resolve);

/* theme  */
const Theme = resolve => require(['../views/theme/index'], resolve);

const logiLayout = resolve => require(['../views/layout/logiLayout'], resolve);

// 成绩管理
const gradePublish = resolve => require(['../views/gradeInquiry/gradePublish'], resolve);
const gradeInquiry = resolve => require(['../views/gradeInquiry/gradeInquiry'], resolve);
const gradeDetail = resolve => require(['../views/gradeInquiry/comps/gradeDetail'], resolve);
// 校本资源
const ziyuanLayout = resolve => require(['../views/gradeInquiry/ziyuanLayout'], resolve);

//学校管理
const schoolManages = resolve => require(['../views/schoolManage/schoolManages'], resolve);
const leaderInfo = resolve => require(['../views/schoolManage/leaderInfo'], resolve); //负责人详情  
const modifySchool = resolve => require(['../views/schoolManage/modifySchool'], resolve); //修改学校信息

// 学生管理
const studentManage = resolve => require(['../views/studentManagement/studentManage'], resolve);
const addStudentPage = resolve => require(['../views/studentManagement/comps/addStudentPage'], resolve);
const classInforPage = resolve => require(['../views/studentManagement/comps/classInforPage'], resolve);
const studentInforPage = resolve => require(['../views/studentManagement/comps/studentInforPage'], resolve);

// 班级管理 
const classStudent = resolve => require(['../views/classAdministration/classStudent'], resolve);
const studentList = resolve => require(['../views/classAdministration/studentList'], resolve);
const addNewStudent = resolve => require(['../views/classAdministration/addNewStudent'], resolve);
const classDetails = resolve => require(['../views/classAdministration/classDetails'], resolve)

//家长管理
const parentManage = resolve => require(['../views/parentManagement/parentManage'], resolve);
const checkParentManage = resolve => require(['../views/parentManagement/checkParentManage'], resolve); //查看信息

// 学生信息反馈

const studInforFeedBack = resolve => require(['../views/studInforFeedBack/studInforFeedBack'], resolve);

// 教师管理
const teacherManage = resolve => require(['../views/teacherManage/teacherManage'], resolve);
const correct = resolve => require(['../views/teacherManage/correct'], resolve);
const teacherClass = resolve => require(['../views/teacherManage/teacherClass'], resolve);

// 食谱
const recipe = resolve => require(['../views/exueManagement/recipeManage/recipe'], resolve);
const recipeDetail = resolve => require(['../views/exueManagement/recipeManage/recipeDetail'], resolve);
const addNewRecipe = resolve => require(['../views/exueManagement/recipeManage/addNewRecipe'], resolve);

// 智慧班牌
// const administrator = resolve => require(['../views/wisdomManagement/administrator'], resolve);
// const syllabusMange = resolve => require(['../views/wisdomManagement/syllabusMange'], resolve); // 课程表 
// const ratingProject = resolve => require(['../views/wisdomManagement/ratingProject'], resolve);
// const modifyRating = resolve => require(['../views/wisdomManagement/modifyRating'], resolve);
// const addSyllabus = resolve => require(['../views/wisdomManagement/addSyllabus'], resolve); // 添加课程表
// const syllabusDetail = resolve => require(['../views/wisdomManagement/syllabusDetail'], resolve); // 课程表详情
// const goPrintSmall = resolve => require(['../views/wisdomManagement/goPrintSmall'], resolve); // 打印课程表5x8 
// const goPrintBig = resolve => require(['../views/wisdomManagement/goPrintBig'], resolve); // 打印课程表7x12

// const customArea = resolve => require(['../views/wisdomManagement/customArea'], resolve);//自定义区域
// const syllabusMange = resolve => require(['../views/wisdomManagement/syllabusMange'], resolve); // 课程表 
// const classDuty = resolve => require(['../views/wisdomManagement/classDuty'], resolve);//班级值日
// const classScore = resolve => require(['../views/wisdomManagement/classScore'], resolve);//班级评分
// const ratingSetting = resolve => require(['../views/wisdomManagement/ratingSetting'], resolve); // 评分项设置
// const examinationMode = resolve => require(['../views/wisdomManagement/examinationMode'], resolve); // 考场模式
// const examinationEdit = resolve => require(['../views/wisdomManagement/examinationEdit'], resolve); // 编辑 
// const checkExam = resolve => require(['../views/wisdomManagement/checkExam'], resolve); // 查看
// const checkExamDetail = resolve => require(['../views/wisdomManagement/checkExamDetail'], resolve); // 详情
// const screensaver = resolve => require(['../views/wisdomManagement/screensaver'], resolve); // 屏保设置

const customArea = resolve => require(['../views/wisdomManagement/customArea'], resolve);// 班级风采
const syllabusMange = resolve => require(['../views/wisdomManagement/syllabusMange'], resolve); // 课程表 
const classDuty = resolve => require(['../views/wisdomManagement/classDuty'], resolve);//班级值日
const classScore = resolve => require(['../views/wisdomManagement/classScore'], resolve);//班级评分
const rateSet = resolve => require(['../views/wisdomManagement/rateSet'], resolve); // 评分设置
const addRate = resolve => require(['../views/wisdomManagement/addRate'], resolve); // 新增评分 
const rateCheck = resolve => require(['../views/wisdomManagement/rateCheck'], resolve); // 查看评分
const examinationMode = resolve => require(['../views/wisdomManagement/examinationMode'], resolve); // 考场模式
const examinationEdit = resolve => require(['../views/wisdomManagement/examinationEdit'], resolve); // 编辑 
const checkExam = resolve => require(['../views/wisdomManagement/checkExam'], resolve); // 查看
const checkExamDetail = resolve => require(['../views/wisdomManagement/checkExamDetail'], resolve); // 详情
const screensaver = resolve => require(['../views/wisdomManagement/screensaver'], resolve); // 屏保设置
const classDeclaration = resolve => require(['../views/wisdomManagement/classDeclaration'], resolve); // 班级宣言
const fameWall = resolve => require(['../views/wisdomManagement/fameWall'], resolve); // 荣誉墙
const homeSchooling = resolve => require(['../views/wisdomManagement/homeSchooling'], resolve); // 家校通
const countdown = resolve => require(['../views/wisdomManagement/countdown'], resolve); // 倒计时
const addScreenImg = resolve => require(['../views/wisdomManagement/addScreenImg'], resolve); // 添加屏保图片
const screenImgEdit = resolve => require(['../views/wisdomManagement/addScreenImg'], resolve); // 编辑屏保图片
const patorlRecord = resolve => require(['../views/attendanceManage/patorlRecord'], resolve); //巡查记录 

// 设备管理
const broadDevice = resolve => require(['../views/deviceManagement/deviceManagement'], resolve);
const checkComment = resolve => require(['../views/deviceManagement/checkComment'], resolve);
const deviceEye = resolve => require(['../views/deviceManagement/deviceEye'], resolve);

// 服务管理
const orderStatistics = resolve => require(['../views/serviceManage/orderStatistics'], resolve);
const orderDetails = resolve => require(['../views/serviceManage/orderDetails'], resolve);

// 账户管理
const accountDetail = resolve => require(['../views/accountManagement/accountDetail'], resolve); //账户详情
const makeAccount = resolve => require(['../views/accountManagement/makeAccount'], resolve); //填写账户

// 空中课堂
const lessonManage = resolve => require(['../views/exueManagement/onlineLesson/lessonManage'], resolve);
const lessonDetail = resolve => require(['../views/exueManagement/onlineLesson/lessonDetail'], resolve);
const commentDetail = resolve => require(['../views/exueManagement/onlineLesson/commentDetail'], resolve);
const addNewLesson = resolve => require(['../views/exueManagement/onlineLesson/addNewLesson'], resolve);

// 权限管理
const authorityComponent = resolve => require(['../views/systemManage/authorityManagement'], resolve);
const addAuthority = resolve => require(['../views/systemManage/authorityManagement/addAuthor'], resolve);
const editAuthority = resolve => require(['../views/systemManage/authorityManagement/editAuthor'], resolve);
const showAuthority = resolve => require(['../views/systemManage/authorityManagement/showAuthor'], resolve);
//  学校通知
const schoolNotice = resolve => require(['../views/schoolNotice/schoolNotice'], resolve);
const noticeUpdata = resolve => require(['../views/schoolNotice/noticeUpdata'], resolve);

//  平安考勤
const attendance = resolve => require(['../views/attendanceManage/attendance'], resolve);
const attendanceReport = resolve => require(['../views/attendanceManage/attendanceReport'], resolve); //考勤报表
const attendanceMsg = resolve => require(['../views/attendanceManage/attendanceMsg'], resolve); //考勤列表
const studentsAttendance = resolve => require(['../views/attendanceManage/studentsAttendance'], resolve); //学生考勤
const teacherAttendance = resolve => require(['../views/attendanceManage/teacherAttendance'], resolve); //教师考勤
const staAttendance = resolve => require(['../views/attendanceManage/staAttendance'], resolve); //考勤统计 

//  考勤设备
const equipment = resolve => require(['../views/equipmentMange/equipment'], resolve);
const getEquipment = resolve => require(['../views/equipmentMange/getEquipment'], resolve); //查看考勤设备

//  一卡通
const presentSettlement = resolve => require(['../views/oneCardSolution/presentSettlement'], resolve); //提现结算
const checkDetails = resolve => require(['../views/oneCardSolution/checkDetails'], resolve); //结算明细
const revenueFlow = resolve => require(['../views/oneCardSolution/revenueFlow'], resolve); //收支流水

//  卡片管理
const cardManage = resolve => require(['../views/cardManagement/cardManagement'], resolve); //卡片管理

// 修改密码
const modifyPass = resolve => require(['../views/userManage/modifyPass'], resolve);
// e校园

const frame= resolve => require(['../views/eschool/frame'], resolve);// 框架设置
const essayManagement= resolve => require(['../views/eschool/essayManagement'], resolve);//文章管理
const addEssay= resolve => require(['../views/eschool/addEssay'], resolve);//新建文章

const teachingManage = resolve => require(['../views/schoolResources/teachingManage'], resolve); //教材管理
const addTeaching = resolve => require(['../views/schoolResources/addTeaching'], resolve); //添加教材
const editTeaching = resolve => require(['../views/schoolResources/editTeaching'], resolve); //编辑教材
Vue.use(Router);



/**
 * icon : the icon show in the sidebar
 * hidden : if hidden:true will not show in the sidebar
 * redirect : if redirect:noredirect will not redirct in the levelbar
 * noDropdown : if noDropdown:true will not has submenu
 * meta : { role: ['admin'] }  will control the page role
 **/

export const constantRouterMap = [
    { path: '/login', component: Login, hidden: true },
    { path: '/authredirect', component: authRedirect, hidden: true },
    { path: '/resetSuccess', component: resetSuccess, hidden: true },
    { path: '/newPassword', component: newPassword, hidden: true, name: '设置新密码' },
    { path: '/reset', component: reset, hidden: true },
    { path: '/studentBackPassword', component: studentBackPassword, hidden: true },
    {
        path: '/userManage/modifyPass',
        name: '修改密码',
        hidden: true,
        component: modifyPass
    },
    {
        path: '/404',
        component: Layout,
        redirect: '/404/index',
        hidden: true,
        children: [
            { path: 'index', component: Err404 }
        ]
    },
    // { path: '/404', component: Err404, hidden: true },
    { path: '/401', component: Err401, hidden: true },
    { path: '/error', component: error, hidden: true },
]

export default new Router({
    // mode: 'history', //后端支持可开
    scrollBehavior: () => ({ y: 0 }),
    routes: constantRouterMap
});

export const homeRouterMap = [{
        path: '/',
        redirect: '/home',
        name: 'e学',
        hidden: true,
    },
    {
        path: '/home',
        redirect: '/home/index',
        name: '数据统计',
        component: Layout,
        icon: 'tuozhuai',
        meta: {
            role: ['admin', '教师活跃度'],
            cache: 'teacherActive'
        },
        noDropdown: false,
        children: [
           { path: 'index', component: home ,name: '作业资源情况' },
           { path: 'teacherActive', component: teacherActive ,name: '教师活跃度' }
        ]
    },
    {
        path: '/schoolManage',
        redirect: '/schoolManage/schoolManages',
        name: '基础管理',
        component: Layout,
        icon: 'zujian',
        meta: {
            role: ['admin', 'boss'],
            cache: 'teacherManage,schoolManage,studentManage,classStudent,parentManage'
        },
        noDropdown: false,
        children: [{
                path: '/schoolManage',
                component: logiLayout,
                name: '学校管理',
                noDropdown: true,
                redirect: '/schoolManage/schoolManages',
                children: [
                    { path: 'schoolManages', component: schoolManages },
                    { path: 'modifySchool/:schoolId', component: modifySchool, name: '修改学校信息' },
                    { path: 'leaderInfo/:schoolId', component: leaderInfo, name: '负责人信息' },
                ]
            },
            {
                path: '/teacherManage',
                component: logiLayout,
                name: '教师管理',
                noDropdown: true,
                redirect: '/teacherManage/teacherManage',
                children: [
                    { path: 'teacherManage', component: teacherManage },
                    { path: 'correct/:teacherId/:schoolType', component: correct, name: '修改' },
                    { path: 'teacherClass/:teacherId/:schoolType', component: teacherClass, name: '任教班級' },
                ]
            },
            {
                path: '/studentManage',
                component: logiLayout,
                name: '学生管理',
                noDropdown: true,
                redirect: '/studentManage/studentManage',
                children: [
                    { path: 'studentManage', component: studentManage },
                    { path: 'addStudentPage', component: addStudentPage, name: '新增学生' },
                    { path: 'classInforPage/:studentId?', component: classInforPage, name: '班级信息' },
                    { path: 'studentInforPage/:studentId?/:classObj?/:id?/:parentPhone?/:studentName?/:isAudit?', component: studentInforPage, name: '学生信息' }
                    // { path: 'studentInforPage/:studentId?/:classObj?', component: studentInforPage, name: '学生信息' }
                ]
            },
            {
                path: '/classStudent',
                component: logiLayout,
                name: '班级管理',
                noDropdown: true,
                redirect: '/classStudent/classStudent',
                children: [{
                        path: 'classStudent',
                        component: classStudent
                    },
                    {
                        path: 'studentList/:id?',
                        component: studentList,
                        name: '班级学生'
                    },
                    {
                        path: 'addNewStudent/:schoolId?/:classId?/:id?',
                        component: addNewStudent,
                        name: '班级新增学生'
                    },
                    {
                        path: 'classDetails/:classId?',
                        component: classDetails,
                        name: '班级详情'
                    }
                ]
            },
            {
                path: '/parentManagement',
                component: logiLayout,
                name: '家长管理',
                noDropdown: true,
                redirect: '/parentManagement/parentManage',
                children: [
                    { path: 'parentManage', component: parentManage },
                    { path: 'checkParentManage/:parentId?/:userId?', component: checkParentManage, name: '查看家长信息' },
                ]
            },
            {
                path: '/studInforFeedBack',
                component: logiLayout,
                name: '学生信息反馈',
                noDropdown: true,
                redirect: '/studInforFeedBack/studInforFeedBack',
                children: [
                    { path: 'studInforFeedBack', component: studInforFeedBack },
                ]
            },
        ],
    },
    {
        path: '/jioaXueManage',
        redirect: '/jioaXueManage/gradeInquiry',
        name: '教学管理',
        component: Layout,
        icon: 'zujian',
        noDropdown: false,
        meta: {
            role: ['admin', 'boss'],
            cache: 'gradeInquiry,schoolResources,lessonManage'
        },
        children: [
            {
                path: '/jioaXueManage',
                component: logiLayout,
                redirect: '/jioaXueManage/gradeInquiry',
                noDropdown: true,
                name: '成绩管理',
                children: [
                    { path: 'gradeInquiry', component: gradeInquiry},
                    { path: 'gradePublish', component: gradePublish, name: '成绩发布' },
                    { path: 'gradeDetail/:pId?/:fSchoolId?', component: gradeDetail, name: '查看详情' }
                ]
            },
            {
                path: '/schoolResources',
                redirect: '/schoolResources/teachingManage',
                name: '校本资源',
                component: ziyuanLayout,
                noDropdown: false,
                children: [
                    {
                        path: '/schoolResources',
                        component: logiLayout,
                        name: '教材管理',
                        noDropdown: true,
                        redirect: '/schoolResources/teachingManage',
                        children: [
                            { path: 'teachingManage', component: teachingManage },
                            { path: 'addTeaching', component: addTeaching, name: '添加教材' },
                            { path: 'editTeaching/:id?', component: editTeaching, name: '编辑教材' },
                        ]
                    }
                ]
            },
            {
                path: '/onlineLesson',
                redirect: 'onlineLesson/list',
                component: ziyuanLayout,
                name: '空中课堂',
                noDropdown: true,
                children: [
                    { path: 'list', component: lessonManage },
                    { path: 'comment/:lId', component: commentDetail, name: '查看评价' },
                    { path: 'lessonDetail/:lId', component: lessonDetail, name: '课程详情' },
                    { path: 'addNewLesson', component: addNewLesson, name: '发布课程' },
                    { path: 'editLesson/:lId?', component: addNewLesson, name: '修改课程' },
                ]
            },
        ]
    },
    {
        path: '/attendance',
        redirect: '/attendance/index',
        name: '校务管理',
        component: Layout,
        icon: 'zujian',
        noDropdown: false,
        meta: {
            role: ['admin', 'boss'],
            cache: 'schoolNotice,essayManagement,recipe,classScore,examinationMode,cardManage'
        },
        children: [
            {
                path: '/attendance',
                redirect: '/attendance/index',
                component: logiLayout,
                name: '平安考勤',
                noDropdown: false,
                children: [
                    { path: 'index', component: attendance, name: '原始数据' },
                    {
                        path: '/attendanceReport',
                        component: ziyuanLayout, 
                        name: '考勤报表',
                        redirect: '/attendanceReport/attendanceReport',
                        noDropdown:true,
                        children:[
                            { path: 'attendanceReport', component: attendanceReport },
                            { path: 'attendanceMsg/:startDate?/:schoolId?/:attendanceTimeId?/:gradeId?/:classId?/:type?',
                             component: attendanceMsg, name: '考勤详情' 
                            }
                        ]
                    },
                    { path: 'studentsAttendance', component: studentsAttendance, name: '学生考勤' },
                    { path: 'teacherAttendance', component: teacherAttendance, name: '教师考勤' },
                    { path: 'staAttendance', component: staAttendance, name: '考勤统计' }
                ]
            },
            {
                path: '/wisdomMange',
                name: '智慧班牌',
                component: logiLayout,
                redirect: '/wisdomMange/customArea',
                meta: {
                    role: ['admin', '智慧班牌'],
                    cache: 'classScore,examinationMode'
                },
                noDropdown: false,
                children: [
                    {
                        path: '/wisdomMange',
                        redirect: '/wisdomMange/customArea',
                        component: ziyuanLayout,
                        name: '班级风采',
                        noDropdown: true,
                        children: [
                            { path: 'customArea', component: customArea },
                        ]
                    },
                    {
                        path: '/classDeclaration',
                        redirect: '/classDeclaration/classDeclaration',
                        component: ziyuanLayout,
                        name: '班级宣言',
                        noDropdown: true,
                        children: [
                            { path: 'classDeclaration', component: classDeclaration },
                        ]
                    },
                    {
                        path: '/fameWall',
                        redirect: '/fameWall/fameWall',
                        component: ziyuanLayout,
                        name: '荣誉墙',
                        noDropdown: true,
                        children: [
                            { path: 'fameWall', component: fameWall },
                        ]
                    },
                    {
                        path: '/syllabusMange',
                        redirect: '/syllabusMange/syllabusMange',
                        component: ziyuanLayout,
                        name: '课程表',
                        noDropdown: true,
                        children: [
                            { path: 'syllabusMange', component: syllabusMange },
                        ]
                    },
                    {
                        path: '/classDuty',
                        redirect: '/classDuty/classDuty',
                        component: ziyuanLayout,
                        name: '班级值日',
                        noDropdown: true,
                        children: [
                            { path: 'classDuty', component: classDuty },
                        ]
                    },
                    {
                        path: '/classScore',
                        redirect: '/classScore/classScore',
                        component: ziyuanLayout,
                        name: '班级评分',
                        noDropdown: true,
                        children: [
                            { path: 'classScore', component: classScore },
                            { path: 'addRate', component: addRate, name: '新增评分' },
                            { path: 'rateSet/:id?', component: rateSet, name: '评分' },
                            { path: 'rateCheck/:id?', component: rateCheck, name: '查看' },
                        ]
                    },
                    {
                        path: '/examinationMode',
                        redirect: '/examinationMode/examinationMode',
                        component: ziyuanLayout,
                        name: '考场模式',
                        noDropdown: true,
                        children: [
                            { path: 'examinationMode', component: examinationMode },
                            { path: 'examinationEdit/:id?', component: examinationEdit, name: '编辑考场' },
                            { path: 'checkExam/:id?', component: checkExam, name: '查看考场' },
                            { path: 'checkExamDetail/:id?', component: checkExamDetail, name: '考场详情' },
                        ]
                    },
                    {
                        path: '/countdown',
                        redirect: '/countdown/countdown',
                        component: ziyuanLayout,
                        name: '倒计时',
                        noDropdown: true,
                        children: [
                            { path: 'countdown', component: countdown },
                        ]
                    },
                    {
                        path: '/screensaver',
                        redirect: '/screensaver/screensaver',
                        component: logiLayout,
                        name: '屏保设置',
                        noDropdown: true,
                        children: [
                            { path: 'screensaver', component: screensaver },
                            { path: 'addScreenImg/:sPosition', component: addScreenImg, name: '添加图片' },
                            { path: 'screenImgEdit/:id/:sPosition', component: screenImgEdit, name: '编辑图片' },
        
                        ]
                    },
                    {
                        path: '/homeSchooling',
                        redirect: '/homeSchooling/homeSchooling',
                        component: ziyuanLayout,
                        name: '家校通',
                        noDropdown: true,
                        children: [
                            { path: 'homeSchooling', component: homeSchooling },
                        ]
                    }, 
                    { path: 'patorlRecord', component: patorlRecord, name: '巡查记录' }      
                ]
            },
            {
                path: '/schoolNotice',
                redirect: '/schoolNotice/index',
                component: logiLayout,
                name: "学校通知",
                noDropdown: true,
                children: [
                    { path: 'index', component: schoolNotice },
                    { path: 'checkNotice/:id/:status', component: noticeUpdata, name: '查看学校通知' },
                    { path: 'updateNotice/:id/:status', component: noticeUpdata, name: '编辑学校通知' },
                    { path: 'addNotice', component: noticeUpdata, name: '添加学校通知' },
                ]
            },
            {
                path: '/eschool',
                redirect: '/eschool/frame',
                name: 'e校园',
                component: logiLayout,
                meta: {
                    role: ['admin', 'e校园'],
                },
                noDropdown: false,
                children: [
                    { path: 'frame', component: frame, name: '框架设置' },
                    {
                        path: '/essayManagement',
                        component: logiLayout,
                        name: '文章管理',
                        noDropdown: true,
                        redirect: '/essayManagement/essayList',
                        children: [
                            { path: 'essayList', component: essayManagement },
                            { path: 'addEssay/:status/:id?', component: addEssay, name: '新建文章' },
                            { path: 'changeEssay/:status/:id?', component: addEssay, name: '编辑文章' },
                        ]
                    }
                ]
            },
            {
                path: '/recipe',
                redirect: '/recipe/list',
                component: logiLayout,
                name: '食谱管理',
                noDropdown: true,
                children: [
                    { path: 'list', component: recipe },
                    { path: 'detail/:rId/:sName', component: recipeDetail, name: '食谱详情' },
                    { path: 'addNewRecipe', component: addNewRecipe, name: '添加食谱' }
                ]
            },
            {
                path: '/cardManagement',
                redirect: '/cardManagement/index',
                component: logiLayout,
                name: '卡片管理',
                noDropdown: true,
                children: [
                    { path: 'index', component: cardManage}
                ]
            },

        ]
    },
    {
        path: '/deviceManagement',
        redirect: '/deviceManagement/broadDevice',
        name: '设备管理',
        component: Layout,
        icon: 'tuozhuai',
        meta: {
            role: ['admin', 'boss'],
            cache: 'broadDevice,deviceEye,equipment'
        },
        noDropdown: false,
        children: [
            {
                path: '/deviceManagement',
                component: logiLayout,
                name: '直播设备管理',
                noDropdown: true,
                redirect: '/deviceManagement/broadDevice',
                children: [
                    { path: 'broadDevice', component: broadDevice },
                    { path: 'checkComment/:id/:status', component: checkComment ,name: '查看评论'},
                ]
            },
            { path: 'deviceEye', component: deviceEye, name: '设备视角' },
            {
                path: '/equipment',
                redirect: 'equipment/index',
                component: logiLayout,
                name: '考勤设备',
                noDropdown: true,
                children: [
                    { path: 'index', component: equipment},
                    { path: 'getEquipment/:id?', component: getEquipment, name: '查看考勤设备' }
                ]
            },
        ]
    },
    {
        path: '/accountMangement',
        redirect: '/accountMangement/accountDetail',
        name: '账务管理',
        component: Layout,
        icon: 'tuozhuai',
        meta: {
            role: ['admin', 'boss'],
            cache: 'accountMangement,presentSettlement'
        },
        noDropdown: false,
        children: [
           {
                path: '/accountMangement',
                component: logiLayout,
                name: '账户管理',
                meta: { role: ['admin', '代理商'] },
                noDropdown: true,
                redirect: '/accountMangement/accountDetail',
                children: [
                    { path: 'accountDetail', component: accountDetail },
                    { path: 'makeAccount', component: makeAccount, name: '填写账户信息' },

                ]
            },
            {
                path: '/oneCardSolution',
                component: logiLayout,
                redirect: '/oneCardSolution/index',
                name: '一卡通',
                noDropdown: false,
                children: [{
                        path: '/oneCardSolution',
                        component: logiLayout,
                        redirect: '/oneCardSolution/index',
                        name: '提现结算',
                        noDropdown: true,
                        children: [
                            { path: 'index', component: presentSettlement },
                            { path: 'checkDetails/:id?', component: checkDetails, name: '结算明细' },
                        ]
                    },
                    { path: 'revenueFlow', component: revenueFlow, name: '收支流水' },
                ]
            },

        ]
    },

    // {
    //     path: '/serviceManage',
    //     redirect: '/serviceManage/serviceContent',
    //     name: '服务订单',
    //     component: Layout,
    //     icon: 'theme',
    //     meta: { role: ['admin', '设备管理'] },
    //     noDropdown: false,
    //     children: [
    //         { path: 'orderStatistics', component: orderStatistics, name: '订单统计' },
    //         { path: 'orderDetails', component: orderDetails, name: '订单明细' }
    //     ]
    // },

    {
        path: '/authority',
        redirect: 'authority/index',
        component: Layout,
        icon: 'quanxian',
        name: "权限管理",
        meta: {
            cache: 'authorityComponent'
        },
        noDropdown: true,
        children: [
            { path: 'index', component: authorityComponent, name: '权限管理' },
            { path: 'addAuthor', component: addAuthority, name: '添加权限' },
            { path: 'editAuthor/:pId', component: editAuthority, name: '修改权限' },
            { path: 'showAuthor/:pId', component: showAuthority, name: '查看权限' }
        ]
    },

    // {
    //   path: '/error',
    //   redirect: '/serverMaintenance',
    //   component: Layout,
    //   icon: 'xinrenzhinan',
    //   name: "服务器维护",
    //   noDropdown: true,
    //   children: [
    //     { path: 'serverMaintenance', component: serverMaintenance}
    //   ]
    // },
    // { path: '*', redirect: '/404', hidden: true },
];